package com.iotechn.unimall.admin.api.area;

import com.iotechn.unimall.core.annotation.HttpMethod;
import com.iotechn.unimall.core.annotation.HttpOpenApi;
import com.iotechn.unimall.core.annotation.HttpParam;
import com.iotechn.unimall.core.annotation.HttpParamType;
import com.iotechn.unimall.core.annotation.param.NotNull;
import com.iotechn.unimall.core.exception.ServiceException;
import com.iotechn.unimall.data.domain.AreaDO;
import com.iotechn.unimall.data.model.Page;

import java.util.List;

/**
 * @author chen
 * @email 1197346512@qq.com
 * @date 2022-04-25 17:56:53
 */
@HttpOpenApi(group = "admin.area", description = "")
public interface AdminAreaService {

    @HttpMethod(description = "列表")
//    @HttpMethod(description = "列表", permission = "list", permissionParentName = "系统管理", permissionName = "区域管理")
    public Page<AreaDO> list(
            @HttpParam(name = "pageNo", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页长度", valueDef = "20") Integer limit,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "列表")
    public List<AreaDO> areaList() throws ServiceException;

    @HttpMethod(description = "创建")
//    @HttpMethod(description = "创建", permission = "admin:area:create", permissionParentName = "系统管理", permissionName = "区域管理")
    public AreaDO create(
            @NotNull @HttpParam(name = "areaDO", type = HttpParamType.COMMON, description = "") AreaDO areaDO,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "修改")
//    @HttpMethod(description = "修改", permission = "admin:area:update", permissionParentName = "系统管理", permissionName = "区域管理")
    public String update(
            @NotNull @HttpParam(name = "areaDO", type = HttpParamType.COMMON, description = "") AreaDO areaDO,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "删除")
//    @HttpMethod(description = "删除", permission = "admin:area:delete", permissionParentName = "系统管理", permissionName = "区域管理")
    public String delete(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "删除Id") Long id,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "详情")
//    @HttpMethod(description = "详情", permission = "admin:area:detail", permissionParentName = "系统管理", permissionName = "区域管理")
    public AreaDO detail(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "Id") Long id,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "激活冻结")
//    @HttpMethod(description = "激活冻结", permission = "admin:area:update", permissionParentName = "系统管理", permissionName = "区域管理")
    public Boolean updateStatus(
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "用户信息") Long id,
            @NotNull @HttpParam(name = "status", type = HttpParamType.COMMON, description = "用户信息") Integer status) throws ServiceException;

}

